﻿
/*----------------------------------------------------------------//
// 文件名：MoNotice.cs
// 文件功能描述：实体 MoNotice.
// 
// 创建标识：2009-05-06
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoNotice
using System;
using System.Data;
using System.Globalization;
using System.Text;
using System.Xml;
using System.Data.Common;
namespace EQT.Model
{
	/// <summary>
	/// 业务实体MoNotice
	/// </summary>
	public partial class MoNotice:ICloneable
	{
		#region 表Notice的字段
		private string _notice_id;
		private string _uid;
		private int _publish_type;
		private string _notice_content;
		private DateTime _create_time;
		private string _title;
		#endregion
		
		#region 构造函数
		public MoNotice()
		{
		    
		    
		    
		    
		    _create_time= DateTime.Now;
		    
		}
		#endregion
		
		#region 拷贝构造函数

		public MoNotice(MoNotice item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoNotice(string notice_id,string uid,int publish_type,string notice_content,DateTime create_time,string title)
		{
		this._notice_id=notice_id;
		this._uid=uid;
		this._publish_type=publish_type;
		this._notice_content=notice_content;
		this._create_time=create_time;
		this._title=title;
		}
		#endregion
		
		#region 表Notice的字段属性
		/// <summary>
		///使用GUID实现；
		/// </summary>
		public string Notice_Id
		{
			get {return _notice_id;}
			set {_notice_id=value;}
		}
		/// <summary>
		/// UID
		/// </summary>
		public string Uid
		{
			get {return _uid;}
			set {_uid=value;}
		}
		/// <summary>
		///内别只有2种：公告，定向消息
		/// </summary>
		public int Publish_Type
		{
			get {return _publish_type;}
			set {_publish_type=value;}
		}
		/// <summary>
		/// NOTICE_CONTENT
		/// </summary>
		public string Notice_Content
		{
			get {return _notice_content;}
			set {_notice_content=value;}
		}
		/// <summary>
		/// CREATE_TIME
		/// </summary>
		public DateTime Create_Time
		{
			get {return _create_time;}
			set {_create_time=value;}
		}
		/// <summary>
		/// TITLE
		/// </summary>
		public string Title
		{
			get {return _title;}
			set {_title=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoNotice CopyTo(MoNotice item)
        {
		    item.Notice_Id=this.Notice_Id;
		    item.Uid=this.Uid;
		    item.Publish_Type=this.Publish_Type;
		    item.Notice_Content=this.Notice_Content;
		    item.Create_Time=this.Create_Time;
		    item.Title=this.Title;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoNotice NewNotice=new MoNotice();
		    NewNotice._notice_id=this._notice_id;
		    NewNotice._uid=this._uid;
		    NewNotice._publish_type=this._publish_type;
		    NewNotice._notice_content=this._notice_content;
		    NewNotice._create_time=this._create_time;
		    NewNotice._title=this._title;
			return NewNotice;
		}
		
		private static MoNotice _empty = new MoNotice(string.Empty,string.Empty,-1,string.Empty,DateTime.MinValue,string.Empty);
        public static MoNotice Empty
        {
            get
            {
                return _empty;
            }
        }
		
		///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {
            if (base.Equals(obj))
            {
                return true;
            }
            else
            {
                MoNotice NewNotice = obj as MoNotice;
                if (NewNotice == null)
                {
                    return false;
                }
                else
                {
				if (NewNotice.Notice_Id==this.Notice_Id && NewNotice.Uid==this.Uid && NewNotice.Publish_Type==this.Publish_Type && NewNotice.Notice_Content==this.Notice_Content && NewNotice.Create_Time==this.Create_Time && NewNotice.Title==this.Title)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format("Notice_Id={0}/Uid={1}/Publish_Type={2}/Notice_Content={3}/Create_Time={4}/Title={5}",_notice_id,_uid,_publish_type,_notice_content,_create_time,_title);
		 
		}
		#endregion
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["Notice_ID"]!=null && row["Notice_ID"]!=DBNull.Value)
			{
			    this.Notice_Id = (string)row["Notice_ID"];
			}
			else
			{
				this.Notice_Id =string.Empty;
			}
		    if(row["UID"]!=null && row["UID"]!=DBNull.Value)
			{
			    this.Uid = (string)row["UID"];
			}
			else
			{
				this.Uid =string.Empty;
			}
		    if(row["Publish_Type"]!=null && row["Publish_Type"]!=DBNull.Value)
			{
			    this.Publish_Type = (int)row["Publish_Type"];
			}
			else
			{
				this.Publish_Type =-1;
			}
		    if(row["Notice_Content"]!=null && row["Notice_Content"]!=DBNull.Value)
			{
			    this.Notice_Content = (string)row["Notice_Content"];
			}
			else
			{
				this.Notice_Content =string.Empty;
			}
		    if(row["Create_Time"]!=null && row["Create_Time"]!=DBNull.Value)
			{
			    this.Create_Time = (DateTime)row["Create_Time"];
			}
			else
			{
				this.Create_Time =DateTime.MinValue;
			}
		    if(row["Title"]!=null && row["Title"]!=DBNull.Value)
			{
			    this.Title = (string)row["Title"];
			}
			else
			{
				this.Title =string.Empty;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["Notice_ID"] = this.Notice_Id;
			row["UID"] = this.Uid;
			row["Publish_Type"] = this.Publish_Type;
			row["Notice_Content"] = this.Notice_Content;
			row["Create_Time"] = this.Create_Time;
			row["Title"] = this.Title;
		}
		#endregion
	}
}
#endregion
